#ifndef TIME_H
#define TIME_H

#include <utility>
#include <iostream>

template<typename T>
class Time {
private:
    T secs, mins;
public:
    // Constructors & destructor
    Time();
    Time(T mins, T secs);
    Time(const Time &other);
    ~Time();

    // Setters & getters
    void setTime(T mins, T secs);
    void setTime(std::pair<T, T> m_s);
    void setSeconds(T secs);
    void setMinutes(T mins);
    std::pair<T, T> getTime();
    T getSeconds();
    T getMinutes();

    // Overloads
    Time & operator=(const Time &other);
    Time & operator=(Time &&other) noexcept;
    Time operator+(const Time &op);
    Time operator-(const Time &op);
    Time & operator+=(const Time &op);
    Time & operator-=(const Time &op);
    bool operator==(const Time &op);
    bool operator!=(const Time &op);
    bool operator<(const Time &op);
    bool operator>(const Time &op);
    bool operator<=(const Time &op);
    bool operator>=(const Time &op);

    // Friend functions
    template<typename U>
    friend std::ostream & operator<<(std::ostream &os, const Time<U> &time);
    template<typename U>
    friend std::istream & operator>>(std::istream &is, Time<U> &time);
};

template<typename T>
Time<T> seconds(T secs);
template<typename T>
Time<T> minutes(T mins);

template<typename T>
std::ostream & operator<<(std::ostream &os, const Time<T> &time);
template<typename T>
std::istream & operator>>(std::istream &is, Time<T> &time);


#include "time.hpp"

#endif // TIME_H
